package ma.ac.onousc.gestionfi.EngagementPaiement.model.DAO.DAOBean;

import java.util.List;

import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

import ma.ac.onousc.gestionfi.EngagementPaiement.model.Prestation;
import ma.ac.onousc.gestionfi.EngagementPaiement.model.TypePrestation;
import ma.ac.onousc.gestionfi.EngagementPaiement.model.DAO.PrestationDAO;
import ma.ac.onousc.gestionfi.budget.model.DAO.DAOBean.GenericEJB3Bean;

@Stateless
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class PrestationDAOBean extends GenericEJB3Bean<Prestation, Integer> implements
PrestationDAO {

	@SuppressWarnings("unchecked")
	@Override
	public List<Prestation> findByTypePrestation(TypePrestation prest) {
		return this.getEntityManager().createNamedQuery("Prestation.findByTypePrestation")
				.setParameter("type", prest).getResultList();
	}

}